import 'package:flutter/material.dart';
import '../Stream/stream_list_demo.dart';
import './bloC_demo.dart';

class BlocListDemo extends StatelessWidget {
  const BlocListDemo({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('BlocListDemo'),
        elevation: 0,
      ),
      body: Container(
          padding: EdgeInsets.all(5.0),
          child: ListView(
            children: <Widget>[itemBuilder('bloCDemo', BloCDemo())],
          )),
    );
  }
}

class ItemBuilder extends StatelessWidget {
  const ItemBuilder(this.title, this.page, {Key key}) : super(key: key);

  final String title;
  final Widget page;

  @override
  Widget build(BuildContext context) {
    return ListTile(
        title: Text(title),
        onTap: () {
          Navigator.of(context)
              .push(MaterialPageRoute(builder: (context) => page));
        });
  }
}
